#include "head_s.h"


// 初始化共享的数据
int init_status(status_t * statu, int num){

    statu->num = num;
    statu->thread_ids = (pthread_t *)malloc(num*sizeof(pthread_t));

    memset(&statu->queue, 0, sizeof(queue_t));

    pthread_mutex_init(&statu->lock, NULL);

    pthread_cond_init(&statu->cond, NULL);

    statu->exit_flag = 0;
    return 0;
}


